-
Notifications
You must be signed in to change notification settings - Fork 995
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(usage): add YARGS_DISABLE_WRAP env variable to disable wrap #2210
Conversation
@bcoe Seems like I needed to use the shim to be compatible with deno. It should be good now. 馃憤 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this contribution, left a suggestion as to how we could potentially keep 100% coverage, and avoid skipping your test.
lib/usage.ts
Outdated
@@ -164,6 +164,9 @@ export function usage(yargs: YargsInstance, shim: PlatformShim) { | |||
}; | |||
|
|||
function getWrap() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So that we can maintain our coverage #s, I would do this:
this.getWrap = () => {
...
}
And then your test can simply be:
const yargs = yargs().wrap(99);
process.env.YARGS_DISABLE_WRAP = 'true';
expect(yargs.getInternalMethods().getUsageInstance().getWrap()).to.equal(null);
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I made the changes 馃憤
@jgoux thank you for the contribution. |
Resolves #2200
I had to modify the test
should wrap based on window-size if no wrap is provided
because the actual length of the non-wrapped output is5
and not4
. 馃憤